import request from '@/utils/request';

// 债务催收列表
export function getDebtListApi(data) {
  return request({
    url: '/users/legal/debt_collections',
    method: 'get',
    data,
  });
}
// 债务催收详情
export function getDebtDetailApi(id) {
  return request({
    url: `/users/legal/debt_collections/${id}`,
    method: 'get',
  });
}
// 创建催收工单
export function createDebtApi(data) {
  return request({
    url: '/users/legal/debt_collections',
    method: 'post',
    data,
  });
}
// 法务咨询列表
export function getConsultListApi(data) {
  return request({
    url: '/users/legal/legal_consultations',
    method: 'get',
    data,
  });
}
// 法务咨询详情
export function getConsultDetailApi(id) {
  return request({
    url: `/users/legal/legal_consultations/${id}`,
    method: 'get',
  });
}
// 创建咨询工单
export function createConsultApi(data) {
  return request({
    url: '/users/legal/legal_consultations',
    method: 'post',
    data,
  });
}
// 与用户相关的工单
export function getWorkOrderListApi(data) {
  return request({
    url: '/users/legal/service_tickets',
    method: 'get',
    data,
  });
}
// 工单会话列表
export function getWorkOrderMessageListApi(ticketId, data) {
  return request({
    url: `/users/legal/service_ticket/${ticketId}/conversations`,
    method: 'get',
    data,
  });
}
// 发送工单消息
export function sendWorkOrderMessageApi(ticketId, data) {
  return request({
    url: `/users/legal/service_ticket/${ticketId}/conversations`,
    method: 'post',
    data,
  });
}
